{% extends 'ClassroomBundle:ClassroomManage:layout.html.twig' %}

{% block title %}教师管理 - {{ parent() }}{% endblock %}

{% set side_nav = 'teachers' %}
{% set script_controller = 'classroombundle/controller/classroom/teacher' %}
{% block main %}

<style>

.price{

  color: #e57259;
  font-size: 16px;

}

.ui-autocomplete {
    border:1px solid #ccc;
    background-color: #FFFFFF;
    box-shadow: 2px 2px 3px #EEEEEE;
}
.ui-autocomplete-ctn{
    margin:0;
    padding:0;
}
.ui-autocomplete-item {
    width: 180px;
    overflow:hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 30px;
    padding:0 10px 0 10px;
    cursor: default;
}
.ui-autocomplete-item-hover {
    background:#f2f2f2;
}
.ui-autocomplete-item-hl {
    background:#F6FF94;
}
</style>
       
<div class="panel panel-default panel-col">
  <div class="panel-heading">教师设置</div>
  <div class="panel-body">

        <form id="teachers-form" class="form-horizontal" method="post">

              {{ web_macro.flash_messages() }}
              {% if teacherIds %}
                <div class="form-group" id="teachers-form-group">
                  <label class="col-md-2 control-label">
                    设置教师
                  </label>
                  <div class="col-md-8 controls">
                    <ul class="teacher-list-group sortable-list list-group" id="teacher-list-group" data-role="list" >
                    </ul>

                    <p class="help-block">
                      <div>相关页面中的老师列举将会按照这里设定的顺序显示。</div>
                      <div>教学服务团队成员有权制订学习计划、答疑、批改作业/试卷、发起活动。</div>
                    </p>

                  </div>

                  <script type="text/plain" data-role="model">
                  {{ teacherItems|json_encode|raw }}
                  </script>
                  <script type="text/x-handlebars-template" data-role="item-template">
                      {% verbatim %}

                      <li class="list-group-item clearfix" data-role="item">
                        <span class="glyphicon glyphicon-resize-vertical sort-handle"></span>
                        <img src="{{ avatar }}" class="avatar-small">
                        <span class="nickname">{{ nickname }}</span>
                        <input type="hidden" name="teacherIds[]" value="{{ id }}">  
                      </li>
                    {% endverbatim %}
                  </script>
                </div>
                <div class="form-group">
                  <div class="col-md-offset-2 col-md-8 controls">
                    <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
                    <button type="submit" class="btn btn-fat btn-primary">保存</button>
                  </div>
                </div>
              
              {% else %}
              <div class="form-group empty">还没有教师!赶紧去设置课程吧！</div>
              {% endif %}

        

        </form>
        

  </div>
</div>

{% endblock %}